package com.woniuxy.shop.Controller;

import com.hc.entity.Goods;
import com.woniuxy.shop.Entity.ResponseEntity;
import com.woniuxy.shop.Service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *@ClassName ShopController
 *@Description
 *@Author TJ
 *@Date 2022/10/24 19:29
 *@Version 1.0
 **/
@RestController
@RequestMapping("shop")
public class ShopController {

    @Autowired
    GoodsService goodsService;

    @GetMapping("/getByShopId/{id}")
    public ResponseEntity<List<Goods>> getByShopId(@PathVariable("id") int id){
        List<Goods> goodsList = goodsService.getByShopId(id);
        return new ResponseEntity ("200","ok",goodsList);
    }
}
 